/*
 * Copyright 2005 罗阳
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.maywide.jdp.dao;

/**
 * 查询模板基类(SQL和参数列表）
 * @author 罗阳
 */
public class QueryTemplate {
	/**
	 * 降序常量
	 */
	public static final String ORDER_DESC = "desc";

	/**
	 * 升序常量
	 */
	public static final String ORDER_ASC = "asc";

	/**
	 * 排序字段
	 */
	protected String sort = null;

	/**
	 * 排序方式
	 */
	protected String dir = ORDER_ASC;

	/**
	 * HQL或SQL的查询字符串
	 */
	protected String queryString = null;
	
	public QueryTemplate(String queryString) {
		this.queryString = queryString;
	}

	public QueryTemplate(String queryString, String sort, String dir) {
		this.queryString = queryString;
		this.sort = sort;
		this.dir = dir;
	}

	/**
	 * @return 返回 queryString。
	 */
	public String getQueryString() {
		return queryString;
	}

	/**
	 * @param queryString

	 *            The queryString to set.
	 */
	public void setQueryString(String queryString) {
		this.queryString = queryString;
	}

	/**
	 * @return 返回 sort。
	 */
	public String getSort() {
		return sort;
	}

	/**
	 * @param sort
	 *            要设置的 sort。
	 */
	public void setSort(String sort) {
		this.sort = sort;
	}

	/**
	 * @return 返回 dir。
	 */
	public String getDir() {
		return dir;
	}

	/**
	 * @param dir
	 *            要设置的 dir。
	 */
	public void setDir(String dir) {
		this.dir = dir;
	}
}
